/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aiaudio.processing;

import java.util.HashMap;

/**
 *
 * @author nastya
 */
public enum ProcessingStage {

    SplitData, CalculateRatings, ReduceData, CalculateNetwork, CalculateMetrics, MakeRecomendation;

    private int getStageIndex() {
        switch (this) {
            case SplitData:
                return 0;
            case CalculateRatings:
                return 1;
            case ReduceData:
                return 2;
            case CalculateNetwork:
                return 3;
            case MakeRecomendation:
                return 4;
            case CalculateMetrics:
                return 5;
            default:
                return 0;
        }
    }

    public int compareStage(ProcessingStage o) {
        if (o == null) {
            return 1;
        }
        int idx1 = getStageIndex();
        int idx2 = o.getStageIndex();

        if (idx1 > idx2) {
            return 1;
        } else if (idx1 < idx2) {
            return -1;
        }

        return 0;
    }
}
